import Vue from 'vue'
import VueRouter from 'vue-router'

import MyDiscover from '@/views/MyDiscover'
import MyMine from '@/views/MyMine'
import MyFriend from '@/views/MyFriend'
import NotFound from '@/views/NotFound'
import TuiJian from '@/views/TuiJian'
import TopList from '@/views/TopList'
import SongList from '@/views/SongList'
Vue.use(VueRouter)

const routes = [
  {
    name: 'discover',
    path: '/discover',
    component: MyDiscover,
    children: [
      {
        name: 'tuijian',
        path: 'tuijian',
        component: TuiJian
      },
      {
        name: 'toplist',
        path: 'toplist',
        component: TopList
      },
      {
        name: 'songlist',
        path: 'songlist',
        component: SongList
      },
    ]
  },
  {
    name: 'my',
    path: '/my',
    component: MyMine
  },
  {
    name: 'friend',
    path: '/friend',
    component: MyFriend
  },
  {
    name: '404',
    path: '*',
    component: NotFound
  }
]

const router = new VueRouter({
  routes
})

export default router
